'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, DATE, STRING, NOW } = Sequelize;
    await queryInterface.createTable('discuss', {
      discussId: {
        type: INTEGER(10),
        primaryKey: true,
        autoIncrement: true,
      },
      topicId: { type: INTEGER },
      userId: { type: STRING(255) },
      replayContent: { type: STRING(255), allowNull: true },
      replayName: { type: STRING(255), allowNull: false },
      created_at: { type: DATE, defaultValue: NOW },
      updated_at: { type: DATE, defaultValue: NOW },
    });
  },

  down: async queryInterface => {
    await queryInterface.dropTable('discuss');
  },
};
